#include <vector>
#include <iostream>
#include <tr1/memory>

using namespace std;

class Solution {
public:
    int a = 0;
    int numOfArrays(int n, int m, int k) {
        vector<vector<vector<int64_t>>> dp(n + 1, vector<vector<int64_t>>(m + 1, vector<int64_t>(k + 2)));
        dp[0][0][0] = 1;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j <= m; j++) {
                for (int c = 0; c <= k; c++) {
                    for (int n = 1; n <= m; n++) {
                        if (n > j) {
                            dp[i + 1][n][c + 1] += dp[i][j][c];
                            dp[i + 1][n][c + 1] %= (int64_t) (1e9 + 7);
                        } else {
                            dp[i + 1][j][c] += dp[i][j][c];
                            dp[i + 1][j][c] %= (int64_t) (1e9 + 7);
                        }
                    }
                }
            }
        }
        int64_t ans = 0;
        for (int i = 0; i <= m; i++) {
            ans += dp[n][i][k];
            ans %= (int64_t) (1e9 + 7);
        }
        return ans;
    }
};

int main() {
    Solution solution;
    solution.numOfArrays(2, 3, 1);
    return 0;
}
